﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="AddArticle.aspx.vb" Inherits="WeightLossProject.AddArticle" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2 class="custom-header">Add Article</h2>
    <asp:Label ID="Label1" runat="server" Text="Article Category" 
    CssClass="formlabel"></asp:Label>
<asp:DropDownList ID="ddlCategory" runat="server" CssClass="frmDisplayEdit" 
    DataSourceID="dsCategories" DataTextField="CategoryName" DataValueField="ID">
</asp:DropDownList>
<br />
    <asp:Label ID="Label2" runat="server" Text="Article Title" 
    CssClass="formlabel"></asp:Label>
<asp:TextBox ID="txtTitle" runat="server" CssClass="frmDisplayEdit"></asp:TextBox>
    <asp:RequiredFieldValidator ID="rfvTxtTitle" runat="server" 
        ControlToValidate="txtTitle" CssClass="error" Display="Dynamic" 
        ErrorMessage="Title is Required!"></asp:RequiredFieldValidator>
<br />
    <asp:Label ID="Label3" runat="server" Text="Details" CssClass="formlabel"></asp:Label>

<asp:TextBox ID="txtDetails" runat="server" CssClass="frmDisplayEdit" 
    TextMode="MultiLine"></asp:TextBox>
    <asp:RegularExpressionValidator ID="rexVTxtDetails" runat="server" 
        ControlToValidate="txtDetails" CssClass="error" 
        ErrorMessage="Article Details should be between 100 and 5000 Characters!" 
        ValidationExpression=".{100,5000}" Display="Dynamic"></asp:RegularExpressionValidator>
    <asp:RequiredFieldValidator ID="rfvTxtDetails" runat="server" 
        ControlToValidate="txtDetails" CssClass="error" Display="Dynamic" 
        ErrorMessage="Article Details are Required!"></asp:RequiredFieldValidator>
<br />
    <asp:Label ID="Label4" runat="server" Text="Picture" CssClass="formlabel"></asp:Label>
    <asp:FileUpload ID="fuPicture" runat="server" CssClass="frmDisplayEdit" />
<br />
<asp:Button ID="btnAddArticle" runat="server" CssClass="frmDisplayEdit" 
    Text="Add Article" />
<br />
<asp:SqlDataSource ID="dsCategories" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
    ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
    SelectCommand="SELECT * FROM [tblCategories]"></asp:SqlDataSource>
</asp:Content>
